#!/bin/bash
APP_HOME="$1"
export TZ="Asia/Shanghai"
if [ $APP_HOME == "" ]
then
    APP_HOME="/data0/java/microserver/shaozi-notification-center"
fi


#shutdown app
./kill-app-force.sh "${APP_HOME}"

sleep 1s

PWD=`pwd`
echo "pwd:"$PWD

if [ ! -d "$APP_HOME/" ]; then
    mkdir $APP_HOME/
fi

cp $PWD/target/shaozi-notification-center.jar $APP_HOME/shaozi-notification-center.jar
#start APP
echo "start $APP_HOME/shaozi-notification-center.jar"
chmod 774 "$APP_HOME"/shaozi-notification-center.jar
java -jar "$APP_HOME"/shaozi-notification-center.jar &
echo "APP is starting!"
